<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>客户管理-分配客服</title>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery/jquery.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/plupload/plupload.full.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery/jquery-ui/jquery-ui.js"></script>

<script src="${pageContext.request.contextPath}/js/bootstrap/bootstrap.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/ui/table/bootstrap-table.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/ui/table/locale/bootstrap-table-zh-CN.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/ui/table/plugins/tableExport.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/ui/table/plugins/table-export.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/ui/table/plugins/jquery.base64.js" type="text/javascript"></script>

<script src="${pageContext.request.contextPath}/ui/layui/layui.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/ui/layui/lay/modules/laydate.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/ui/layui/lay/modules/layer.js" type="text/javascript"></script>
 <script src="${pageContext.request.contextPath}/ui/layui/lay/modules/form.js" type="text/javascript"></script>
 <link rel="stylesheet" href="${pageContext.request.contextPath}/ui/layui/css/modules/laydate/laydate.css" >
 <link rel="stylesheet" href="${pageContext.request.contextPath}/css/jquery-css/jquery-ui.css">
 <link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap-css/bootstrap.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/ui/table/bootstrap-table.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/ui/layui/css/layui.css" >
<link rel="stylesheet" href="${pageContext.request.contextPath}/ui/layui/css/global.css" >
<link rel="stylesheet" href="${pageContext.request.contextPath}/ui/layui/css/modules/layer/default/layer.css" >
 <link rel="stylesheet" href="${pageContext.request.contextPath}/ui/layui/css/modules/code.css" >


 <style>
  .container{
   	width:95%;
   	
  }
  
  .modal-company{
  	width:700px;
  }
  .modal-body{
    max-height:750px
  }
   .modal-body-company{
  	height:500px;
  }
  
   .modal-account{
  	width:400px;
  	z-index:2000;
  	left:65%;
  	
  }
  
  .modal-account.fade.in{
    top:15%;
  }
 
  
   .modal-body-account{
  	height:200px;
  }
  

  
  
  
  </style>

</head>

<body>
<%@include file="/webpage/frame/top.jsp" %>
<div class="container">
	<div id="account-modal" class="modal-account modal fade" style="display:none">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <span class="modal-title"></span>
                    <span class="alert-account"></span>
                </div>
                <div class="modal-body-account modal-body">
                    <div class="form-group">
                        <label>账户名称</label>
                        <input type="text" class="form-control" name="loginName" placeholder="账户名称">
                    </div>
                    <div class="form-group">
                        <label>账户密码</label>
                        <input type="text" class="form-control" name="loginPassword" placeholder="账户密码">
                        <input type="hidden" class="form-control" name="companyId">
                        <input type="hidden" class="form-control" name="typeTag">
                    </div>
                    <div class="form-group">
                    	 <label>所属平台</label>
<!--                     <select name="typeTag" id="typeTag"  lay-verify="required" title="semPlatformName"  >
	                    	 <option value="baidu"  selected>百度推广</option>
	                    	 <option value="360">360推广</option>
                    	 </select> -->
                    	 <input type="text" class="form-control" name="semPlatformName" id="accountPlatformName" readonly="readonly"/>
                    	 
                    </div>
                    <div class="form-group">
                        <label>CPC</label>
                        <input type="text" class="form-control" name="hitAvgPrice" placeholder="平均点击价格CPC">                       
                    </div>
                    <div class="form-group">
                        <label>绑定手机</label>
                        <input type="text" class="form-control" name="bindPhone" placeholder="绑定手机">                       
                    </div>
                    <div class="form-group">
                        <label>日预算</label>
                        <input type="text" class="form-control" name="budgetDay" placeholder="日预算">                       
                    </div>                              
                </div>
                 
                <div class="modal-footer">
                    <button type="button" class="btn btn-default"  data-dismiss="account-modal" id="account_close" >关闭</button>
                    <button type="button" class="btn btn-primary submit-account">提交账户资料</button>
                </div>
            </div>
        </div>
    </div>
		<div id="modal" class="modal-company modal fade" style="display:none">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    
                    <span class="modal-title"></span><span class="alert-company"></span>
                </div>
                <div class="modal-body-company modal-body">
                    <div class="form-group">
                        <label>公司名称</label>
                        <input type="text" class="form-control" name="companyName" placeholder="公司名称" readonly="readonly" style="width:400px">
                    </div>
                    
                    <div class="form-group">
                        <label>客户姓名</label>
                        <input type="text" class="form-control" name="customerName" placeholder="" readonly="readonly">
                    </div>
                    
                    <div class="form-group">
                    	 <label>所属行业</label>
                    	 <select name="industryId" id="industry"  lay-verify="required" lay-search="required" >
                    	 
                    	 
                    	 </select>
                    </div>
                      <div class="form-group">
                    	 <label>客服分配</label>
                    	 <select name="userId" id="user"  lay-verify="required" lay-search="required" >
                    	 </select>
                    </div>
                    <div class="form-group">
                        <label>续费状态</label>
                        <input type="text" class="form-control" name="companyStateValue" readonly="readonly">
<!--                    <select name="companyState"  class="form-control">
                       		<option value="0">首次付费</option>
                       		<option value="1">续费</option>
                       		<option value="2">跟进</option>
                       		<option value="3">注销</option>
                       </select> -->
                    </div>
                    
                    <div class="form-group">
                        <label>注册时间</label>
                        <input type="text" class="form-control" name="registerTime" lay-verify="date"   placeholder="注册时间" id="registerTime" readonly="readonly">
                    </div>
                    <div class="form-group">
                        <label>客户联系电话</label>
                        <input type="text" class="form-control" name="phone" placeholder="" readonly="readonly">
                    </div>
                     <div class="form-group">
                        <label>电邮</label>
                        <input type="text" class="form-control" name="email" placeholder="" readonly="readonly">
                    </div>
                     <div class="form-group">
                        <label>公司地址</label>
                        <input type="text" class="form-control" name="address" placeholder="" readonly="readonly">
                    </div>
                     <div class="form-group">
                        <label>邮编</label>
                        <input type="text" class="form-control" name="postcard" placeholder="" readonly="readonly">
                    </div>
                     <div class="form-group">
                        <label>备注</label>
                        <textarea placeholder="" class="layui-textarea" name="remark" readonly="readonly"></textarea>
                    </div>
<!--                  <p class="account-toolbar">
                 	<a class="create-account btn btn-default" href="javascript:">新建账户</a>                 
                 </p> -->
                <table id="accounttable"  data-show-refresh="true"           
               data-click-to-select="true"
			   data-pagination="true"		
			   data-toolbar=".account-toolbar" 
			   data-url=""
			    >
               <!-- data-show-columns="true" -->
                		 <thead>
                		   <tr>              			
            				<th data-field="id" data-visible="false">ID</th>
               			    <th data-field="loginName">账户名</th>
                			<th data-field="loginPassword">账户密码</th>
                			<th data-field="semPlatformName">账户所属</th>
                			<th data-field="hitAvgPrice">CPC</th>
                			<th data-field="bindPhone">绑定手机</th>
                			<th data-field="budgetDay">日预算</th>
                			<th data-field="typeTag" data-visible="false">渠道标志</th>           			
                			<th data-field="action"
                    				data-align="center"
                   					 data-formatter="accountActionFormatter"
                   					 data-events="actionEvents">操作</th>
            			   </tr>
                       </thead>
                </table>
                </div>
                 
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary submit">提交公司资料</button>
                </div>
            </div>
        </div>
    </div>
		<p class="toolbar">
            <button type="button" class="export-excel btn btn-primary btn-xs" data-table="#companytable">导出Excel</button>
           <!-- <a class="create btn btn-default" href="javascript:">创建公司</a> -->
           <span class="alert"></span>
        </p>
		
     
		<table id="companytable"  data-show-refresh="true"
               data-search="true"
               data-click-to-select="true"
               data-show-export="true"
               data-query-params="queryParams"
			   data-pagination="true"		   
               data-toolbar=".toolbar" 
               data-show-columns="true"
               data-sort-name="registerTime" 
               data-sort-order="desc"                          
               >
            <thead>
            <tr>
            	<th data-field="state" data-radio="true"></th>
            	<th data-field="id" data-show="true" data-visible="false">id</th>
                <th data-field="companyName" data-sortable="true">客户公司名称</th>
                <th data-field="customerName" data-visible="false">客户姓名</th>
                <th data-field="companyStateValue" data-sortable="true">续费状态</th>
                <th data-field="phone" data-sortable="true">客户联系电话</th>
                <th data-field="registerTime" data-visible="false">注册时间</th>
                <th data-field="username" data-sortable="true">客服分配</th>
                <th data-field="industry" data-sortable="true">所属行业</th>
                <th data-field="isHasAccount" data-visible="false">是否已添加账户</th>
      			<th data-field="loginName" data-sortable="true">账户名</th>
      			<th data-field="loginPassword" data-sortable="true">账户密码</th>
       			<th data-field="semPlatformName" data-sortable="true">账户所属</th>
       			<th data-field="hitAvgPrice" data-sortable="true">CPC</th>
       			<th data-field="bindPhone" data-sortable="true">绑定手机</th>
       			<th data-field="budgetDay" data-sortable="true">日预算</th>
       			<th data-field="email" data-visible="false">电邮</th>
       			<th data-field="address" data-visible="false">公司地址</th>
       			<th data-field="postcard" data-visible="false">邮编</th>               
       			<th data-field="remark" data-visible="false">备注</th>                 
                <th data-field="action"
                    data-align="center"
                    data-formatter="actionFormatter"
                    data-events="actionEvents">操作</th>
            </tr>
            </thead>
			
		</table>
		</div>
<script>
    //获取行业列表
	$.get("${pageContext.request.contextPath}/industryController.do?getALLIndustryByPage",
			function(result){
		      var data = $.parseJSON(result);
		     
		       for(i=0;i<data.length;i++){
		    	  
		    	  $("#industry").append("<option value="+data[i]["industryId"]+" >"+data[i]["industryName"]+"</option>");
		       }
		    	
			}
			
		);
    
    //获取sem用户
	$.get("${pageContext.request.contextPath}/userController.do?getSem",
			function(result){
		      var data = $.parseJSON(result);
		     
		       for(i=0;i<data.length;i++){
		    	  
		    	  $("#user").append("<option value="+data[i]["id"]+" >"+data[i]["employeeName"]+"</option>");
		       }
		    	
			}
			
		);
    
     

</script>		
<!-- 日期选择代码  -->
<!-- <script>
layui.use('laydate', function(){
  var laydate = layui.laydate;
    
  /*  var end = {
     min: '1970-01-01 23:59:59'
    ,max:  laydate.now()
    ,istoday: true
    
  };
   document.getElementById('registerTime').onclick = function(){
    end.elem = this
    laydate(end);
  } */
  
  var allTime = {
     min: '1970-01-01 23:59:59'
    ,max: '2099-06-16 23:59:59'
    ,istoday: true
    
  };
  document.getElementById('adOnlineDate').onclick = function(){
	allTime.elem = this
    laydate(allTime);
  }
  document.getElementById('adOfflineDate').onclick = function(){
	allTime.elem = this
    laydate(allTime);
  }
  
});
</script>	 -->
		<!-- 上传组件初始化代码 -->
<script>

    var API_URL = '${pageContext.request.contextPath}/companyController.do?getCompanys';
	var ACCOUNT_URL = '${pageContext.request.contextPath}/accountController.do?loadCompanyAccount'
    var COMPANY_DELETE = '${pageContext.request.contextPath}/companyController.do?delCompany'
    var ACCOUNT_DELETE='${pageContext.request.contextPath}/accountController.do?deleteTempAccount';
	var account_totaldata = '';
	var account_str='';
	var is_accountsubmit = false;
    //获取加载公司列表
			var $table = $('#companytable').bootstrapTable(
    		{
    			url: API_URL,
    			pageSize:25,
    			pageList : [15, 25, 100, 500],
    			height: getHeight()
    		}
    ),
      
        $modal = $('#modal').modal({show: false}),
        $alert = $('.alert').hide();
    	$alert_company = $('.alert-company').hide();
	
    	//获取相对的固定高度
   	   function getHeight() {
   	        return $(window).height()-200;
   	    }    	
    	
	//账户列表开始加载
     $accounttable = $('#accounttable').bootstrapTable(
        		{
        			url:ACCOUNT_URL,
        			pageSize:5,
        			queryParams:queryAccountParams
        		}
        );		
    
    $account_modal = $('#account-modal').modal({show: false}),
    $alert_account = $('.alert-account').hide();
	//账户增删改查动作
	var account_data = {};
    $(function () {
    	$('.create-account').click(function () {
    		account_data["id"] = '';
            showAccountModal($(this).text());
        });
    	
    	$('#account_close').click(function(){
    		$account_modal.modal('hide');
    		$("#alert-account").hide();
    	});
    	
    	$('.submit-account').click(function () {
    	var prevent = true;
    	//var account_submit_path = '${pageContext.request.contextPath}/accountController.do?saveTempAccount'
    	var account_submit_path = '${pageContext.request.contextPath}/accountController.do?updateAccount'
    	//拼接json数据
    	
    	
    	//var  accountPlatformName = $("#typeTag").find("option:selected").text();
    	//$("#accountPlatformName").val(
    	//		accountPlatformName
    	//);
    	
    	if($account_modal.data("id")){
    		account_data["id"]= $account_modal.data("id");
    		
    	}
    	//console.log($("#accountPlatformName").val());
    	$account_modal.find('input[name]').each(function () {
    		if($(this).attr('name')=='loginName'){
    			if($(this).val()==''){
    				showAlertAccount("账户名不能为空", "danger");
    				prevent= false;
    				return false;
    			}
    		}
    		
    		if($(this).attr('name')=='loginPassword'){
    			if($(this).val()==''){
    				showAlertAccount("账户密码不能为空", "danger");
    				prevent= false;
    				return false;
    			}
    		}
    		
    		
			account_data[$(this).attr('name')] = $(this).val();
	 });
    	
    	if(prevent==false){
    		return false;
    	}
    	
    	$account_modal.find('select[name]').each(function(){
    			account_data[$(this).attr('name')]	= $(this).val();
    			account_data[$(this).attr('title')] = $(this).find("option:selected").text();
    			
    			
        });
    	
    	//查看是否有公司id
    	account_data['companyId']=$account_modal.data("companyId");
    	
    	//拼接账户数据
    	if(account_data['companyId']==''||account_data['companyId']==undefined){
    		if(account_totaldata==''){
        		
        		account_totaldata+=JSON.stringify(account_data);
        	}else{
        		account_totaldata+=","+JSON.stringify(account_data);
        	}
        	account_str="["+account_totaldata+"]";
        	
        	$accounttable.bootstrapTable('load',JSON.parse(account_str));
        	$account_modal.modal('hide');
    	}else{
    		//提交临时数据
     		 $.ajax({
               url: account_submit_path,
               type: 'post',
               contentType: 'application/json',
               data: JSON.stringify(account_data),
               success: function (data,status) {
               		result = JSON.parse(data);
               		
               		if(result.success==true){
               		 $account_modal.modal('hide');
                     $accounttable.bootstrapTable('refresh');
                     showAlertAccount(($account_modal.data('id') ? '更新' : '新建') + '账户成功', 'success');
                     is_accountsubmit = true;
               		}else{
               	
                     showAlertAccount(($account_modal.data('id') ? '更新' : '新建') + '失败!'+result.msg, 'danger');
                     //console.log('lost');
                     return false;
               		}
                  
                   
                  
               },
               error: function () {
                   
                   	showAlertAccount(($account_modal.data('id') ? '更新' : '新建') + '失败!'+result.msg, 'danger');
               }
           });
    		
    	}   	  		    			
        });
    });
    
    function showAccountModal(title, row) {
        row = row || {
            id: '',
            loginName: '',
            loginPassword:'',
            companyId:''
            
        }; // default row value
        $(".alert-account").hide();
        $account_modal.data('id', row.id);
        $account_modal.data('companyId',$modal.data('id'));
        $account_modal.find('.modal-title').text(title);
        for (var name in row) {
        	$account_modal.find('input[name="' + name + '"]').val(row[name]);
        	
        }
        
       
       
        
        $account_modal.modal('show');
       
    }
    
    //账户更新
    function accountActionFormatter(value) {
        return [
            '  <a class="update-account btn btn-default" href="javascript:" title="修改账户资料">编辑</a>',
            /* '  <a class="remove-account btn btn-default" href="javascript:" title="删除账户资料">删除</a>', */
        ].join('');
    }

    $(function () {
    	//获取选中值
    	
    	 TableExport.init();
    	//导出按钮
    	$('#export').click(function () {
    		
    	  	$table.tableExport({
    	      type: 'excel',
    	      escape: false
    	    });
    	  });
        // create event
        $('.create').click(function () {
        	$accounttable.bootstrapTable('refresh');
            showModal($(this).text());
        });

        $modal.find('.submit').click(function () {
        	
        	var prevent = true;
        	var submitPath = '${pageContext.request.contextPath}/companyController.do?saveCompany';
        	
            var row = {};
			
            if($modal.data('id')){
            	row['id']=$modal.data('id')
            	
            }
            $modal.find('input[name]').each(function () {          	
            	if($(this).attr('name')=='companyName'){
        			if($(this).val()==''){
        				showAlertCompany("公司名不能为空", "danger");
        				prevent= false;
        				return false;
        			}else {
        				if(row['id']==undefined){
        					$.get('${pageContext.request.contextPath}/companyController.do?checkCompanyName&companyName='+$(this).val(),function(data,status){
           					 data=data.replace(/\"/g, "");
           					 //console.log(data);
           				 		if(data=="0"){
           					 		showAlertCompany("公司名不能重复", "danger");
           					 		prevent= false;
               				
           				 	 }
           				
           				
           					});
        				}        					        				
        			}
        		}
            	
            	if($(this).attr('name')=='email'){
        			if($(this).val()!=''){
        				if(!isEmail($(this).val()))
        				{
        					showAlertCompany("请输入正确的邮件格式", "danger");
            				prevent= false;
            				return false;
        				}
        				
        			}
        			
        		}
            	
            	
                row[$(this).attr('name')] = $(this).val();
            });
            
           
            $modal.find('select[name]').each(function(){
            	row[$(this).attr('name')]	= $(this).val();
            });
            $modal.find('textarea[name]').each(function(){
            	row[$(this).attr('name')]	= $(this).val();
            });
                                
          
            //row['accountInfos']=$accounttable.bootstrapTable('getData');
            //console.log(JSON.stringify(row));
				
            setTimeout(function(){
            	 if(prevent==false){
                 	return false;
                 }
            	$.ajax({
                    url: submitPath,
                    type: 'post',
                    contentType: 'application/json',
                    //dataType: 'json', //预期的服务器响应的数据类型。
                    data: JSON.stringify(row),
                    success: function (data,status) {
                        $modal.modal('hide');
                        $table.bootstrapTable('refresh');
                        result = JSON.parse(data);
                        //console.log(result);
                        if(result.success){
                        	 is_accountsubmit =  false; 
                        	 showAlert(($modal.data('id') ? '更新' : '新建') + '公司成功', 'success');
                        }else{
                        	 
                        	 showAlert(($modal.data('id') ? '更新' : '新建') + '公司失败'+result.msg, 'danger');
                        }
                       
                    },
                    error: function () {
                        $modal.modal('hide');
                        showAlert(($modal.data('id') ? '更新' : '新建') + '失败异常', 'danger');
                    }
                });
            },1000);
            
            	
            
            
        });
    });
    
    function queryAccountParams(params) {  //配置参数  
        
    	var queryCompanyId = $modal.data("id");
        //console.log("queryCompanyId:"+queryCompanyId)
        if(queryCompanyId==''){
        	queryCompanyId = undefined;
        }
        
    	var temp = {   //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的  
          companyId:queryCompanyId
           
        };  
        return temp;  
      }  

    function queryParams(params) {
        return {};
    }

    function actionFormatter(value,row, index) {
    
    	buttonArray =  new Array();
    	buttonArray[0] = '<a class="update btn btn-default" href="javascript:" title="修改公司资料">编辑</a>';
    	/* buttonArray[1] = '<a class="remove btn btn-default" href="javascript:"  title="删除公司资料">删除</a>'; */
    	//console.log(row.isHasBaiduData);
/*     	if(row.isHasBaiduData!='0'){
    		buttonArray[2]='<a class="lookbaidu btn btn-default" href="javascript:" title="查看百度推广数据">查看百度数据</a>';
    	} */
    	
        return buttonArray.join(' ');
    }
    
    

    // update and delete events
    window.actionEvents = {
/*     	'click .lookbaidu': function (e, value, row) {
			$(location).attr('href','${pageContext.request.contextPath}/promoteDataController.do?showBaidu_manager&companyId='+row.id);
		}, */
        'click .update': function (e, value, row) {
        	
            showModal($(this).attr('title'), row);
        },
        
        'click .update-account': function (e, value, row) {
        	account_data["id"]='0';
        	showAccountModal($(this).attr('title'), row);
        },
        'click .remove': function (e, value, row) {
        	
            if (confirm('你确定要删除这信息?')) {
                $.ajax({
                    url: COMPANY_DELETE,
                    type: 'post',
                    data:{id: row.id
                    	     },
                    success: function () {
                        $table.bootstrapTable('refresh');
                        showAlert('删除公司!', 'success');
                    },
                    error: function () {
                        showAlert('删除失败!', 'danger');
                    }
                })
            }
        },
        
        'click .remove-account':function(e,value,row){
        	
        	 if (confirm('你确定要删除这信息?')) {
        		
        		
        		 $.ajax({
                     url: ACCOUNT_DELETE,
                     type: 'post',
                     data:{id: row.id,
                    	 	  companyId:$modal.data('id')},
                     success: function () {
                         $accounttable.bootstrapTable('refresh');
                         showAlert('删除账户成功!', 'success');
                     },
                     error: function () {
                         showAlert('删除账户失败!', 'danger');
                     }
                 })
                 
        	 }
        }
    };

    //弹出窗口-公司信息
    function showModal(title, row) {
        row = row || {
            id: '',
            companyName: '',
            companyState:'1',
            industryId:"1",
            userId:"",
            registerTime:"",
            phone:"",
            email:"",
            address:""
            
        }; // default row value

        $modal.data('id', row.id);
        $modal.find('.modal-title').text(title);
       
   
        for (var name in row) {
            $modal.find('input[name="' + name + '"]').val(row[name]);
            $modal.find('select[name="' + name + '"]').find("option[value='"+row[name]+"']").attr("selected",true);
            $modal.find('textarea[name="' + name + '"]').val(row[name]);
        }
        
       
       
        
        $modal.modal('show');
      
        $accounttable.bootstrapTable('refresh');
    }

    function showAlert(title, type) {
        $alert.attr('class', 'alert alert-' + type || 'success')
              .html('<i class="glyphicon glyphicon-check"></i> ' + title).show();
        setTimeout(function () {
            $alert.hide();
        }, 3000);
    }
    
    function showAlertCompany(title, type) {
        $alert_company.attr('class', 'alert-company alert alert-' + type || 'success')
              .html('<i class="glyphicon glyphicon-check"></i> ' + title).show();
        setTimeout(function () {
        	$alert_company.hide();
        }, 3000);
    }
    
    function showAlertAccount(title, type) {
        $alert_account.attr('class', 'alert-account alert alert-' + type || 'success')
              .html('<i class="glyphicon glyphicon-check"></i> ' + title).show();
        if(type=='success'){
        	setTimeout(function () {
            	$alert_account.hide();
            }, 3000);
        }
        
    }
    //公司表设置结束
    
    function isEmail(str){
		var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
		return reg.test(str);
	} 
    

    
   
</script>
<%@include file="/webpage/frame/bottom.jsp" %>
</body>
</html>